import { BasicPageParams, BasicFetchResult } from '@/api/model/baseModel';

/**
 * 配置分类搜索
 */
export type TabConfigCatListParams = {
  title?: string;
  status?: number | string;
};

/**
 * 配置列表
 */
export interface TabConfigCatItem {
  id: string;
  account: string;
  email: string;
  nickname: string;
  role: number;
  createTime: string;
  remark: string;
  status: number;
}

// 配置分类搜索
export type TabConfigCatPageParams = BasicPageParams & TabConfigCatListParams;
// 配置分类列表
export type TabConfigCatPageListGetResultModel = BasicFetchResult<TabConfigCatItem>;

/**
 * 配置搜索
 */
export type SettingListParams = {
  tab_id?: number | string;
  name?: string;
};

/**
 * 配置列表
 */
export interface SettingListItem {
  id: string;
  account: string;
  email: string;
  nickname: string;
  role: number;
  createTime: string;
  remark: string;
  status: number;
}

/**
 * 配置表单
 */
export type SettingParams = {
  id?: number | string;
  config_tab_id?: number | string;
  title: string;
  menu_name: string;
  value: string;
  type?: number;
  sort?: number | string;
  status?: number;
  remarks?: string;
};

// 配置搜索
export type SettingPageParams = BasicPageParams & SettingListParams;
// 配置数据列表
export type SettingPageListGetResultModel = BasicFetchResult<SettingListItem>;

/**
 * 保存配置表单
 */
export type SaveBasicsParams = {
  station_open?: number | string;
  site_name?: string;
  site_url?: string;
  icp_record_No?: string;
  icp_url?: string;
  network_security?: string;
  network_security_url?: string;
  tengxun_map_key?: string;
  statistic_script?: string;
  upload_type?: number | string;
  thumb_big_width?: number | string;
  thumb_big_height?: number | string;
  thumb_mid_width?: number | string;
  thumb_mid_height?: number | string;
  thumb_small_width?: number | string;
  thumb_small_height?: number | string;
  image_watermark_status?: number | string;
  watermark_type?: number | string;
  watermark_text?: string;
  watermark_text_angle?: string;
  watermark_text_color?: string;
  watermark_text_size?: string;
  watermark_position?: number;
  watermark_image?: string[];
  watermark_opacity?: string;
  watermark_rotate?: string;
  watermark_x?: number | string;
  watermark_y?: number | string;
};

/**
 * 管理员搜索
 */
export type AdminListParams = {
  name?: string;
  roles?: number | string;
  status?: number | string;
};

export interface AdminListItem {
  id: string;
  account: string;
  email: string;
  nickname: string;
  role: number;
  createTime: string;
  remark: string;
  status: number;
}

/**
 * 角色表单
 */
export type AdminParams = {
  id?: number | string;
  username: string;
  password: string;
  true_name?: string;
  face?: string;
  phone?: string;
  email?: string;
  email_status?: number;
  birthday?: Date;
  last_ip?: string;
  last_time?: Date;
  status?: number;
  roles?: Array<number | string>;
};

// 管理员搜索
export type AdminPageParams = BasicPageParams & AdminListParams;
// 管理员数据列表
export type AdminPageListGetResultModel = BasicFetchResult<AdminListItem>;

/**
 * 角色搜索
 */
export type RoleListParams = {
  role_name?: string;
  status?: string;
};

/**
 * 角色数据列表
 */
export interface RoleListItem {
  id: number | string;
  role_name: string;
  rules_name: string;
  status: number;
  remarks: string;
  create_time: number | string;
  update_time: number | string;
}

/**
 * 下拉角色列表
 */
export interface RoleSelectListItem {
  id: number | string;
  role_name: string;
}

// 查询权限列表
export interface RoleList {
  id: number | string;
  pid: number | string;
  title: string;
  children?: Array<number | string>;
  expand?: boolean;
}

/**
 * 角色表单
 */
export type RoleParams = {
  id?: number | string;
  role_name?: string;
  status?: number | string;
  checked_menus?: Array<number | string>;
};

// 角色搜索
export type RolePageParams = BasicPageParams & RoleListParams;
// 角色数据列表
export type RolePageListGetResultModel = BasicFetchResult<RoleListItem>;
// 下拉列表
export type RoleSelectListGetResultModel = BasicFetchResult<RoleSelectListItem>;
// 权限列表
export type RoleListGetResultModel = RoleList[];

/**
 * 部门搜索
 */
export type DeptListParams = {
  dept_name?: string;
  status?: number | string;
};

/**
 * 部门数据列表
 */
export interface DeptListItem {
  id: number | string;
  pid: number | string;
  dept_name: string;
  sort: number;
  status: number;
  remarks: string;
  create_time: string | number;
  update_time: string | number;
}

/**
 * 部门表单
 */
export type DeptParams = {
  id?: number;
  pid?: number | string;
  dept_name: string;
  sort?: number;
  status?: number | string;
  remarks?: string;
};

// 部门搜索
export type DeptPageParams = BasicPageParams & DeptListParams;
// 部门数据列表
export type DeptListGetResultModel = BasicFetchResult<DeptListItem>;

/**
 * 菜单搜索
 */
export type MenuListParams = {
  keyword?: string;
  is_show?: string;
};

/**
 * 菜单列表
 */
export interface MenuListItem {
  id: string | number;
  menu_name: string;
  icon?: string;
  sort: string;
  status: number;
  auth_type: number | string;
  api_url?: string;
  menu_path: string;
  unique_auth: string;
  create_time: string | number;
  update_time: string | number;
}

/**
 * 菜单表单
 */
export type MenusParams = {
  id?: number;
  auth_type: number;
  menu_name: string;
  name_path: string;
  pid?: number;
  menu_path?: string;
  unique_auth?: string;
  icon?: string;
  methods?: string;
  api_url?: string;
  redirect?: string;
  sort?: number;
  is_show?: number;
  is_redirect?: number;
  is_show_path?: number;
  remarks: string;
};

// 菜单搜索
export type MenuPageParams = BasicPageParams & MenuListParams;
// 菜单数据列表
export type MenuListGetResultModel = BasicFetchResult<MenuListItem>;

/**
 * 云存储搜索
 */
export type StorageListParams = {
  type?: number | string;
};

/**
 * 云存储表单
 */
export type StorageListItem = {
  id?: number;
  auth_type: number;
  menu_name: string;
  name_path: string;
  pid?: number;
  menu_path?: string;
  unique_auth?: string;
  icon?: string;
  methods?: string;
  api_url?: string;
  redirect?: string;
  sort?: number;
  is_show?: number;
  is_redirect?: number;
  is_show_path?: number;
  remarks: string;
};

/**
 * 创建云存储数据表单
 */
export type StorageParams = {
  appid?: string;
  accessKey?: string;
  secretKey?: string;
  name?: string;
  region?: string;
  acl?: string;
};

/**
 * 保存云存储数据表单
 */
export type StorageConfigParams = {
  accessKey?: string;
  secretKey?: string;
  appid?: string;
  storageRegion?: string;
};

/**
 * 修改云存储域名数据表单
 */
export type StorageDomainParams = {
  domain: string;
};

// 云存储搜索
export type StoragePageParams = BasicPageParams & StorageListParams;
// 云存储数据列表
export type StorageListGetResultModel = BasicFetchResult<StorageListItem>;
